package com.alks.pad.controller.padCollectUser;

import com.alks.common.aop.ApiRestController;
import com.alks.common.service.RedisService;
import com.alks.entity.data.response.ResponseInfo;
import com.alks.pad.data.request.padCollectUser.PadCollectUserRequest;
import com.alks.pad.service.padCollectUser.PadUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import javax.servlet.http.HttpServletRequest;

@ApiRestController("/pad/user")
@Api(tags = {"App登录"})
@Slf4j
//@CrossOrigin(origins = "*")
public class PadUserController {
    @Autowired
    private PadUserService padCollectUserService;
    @Autowired
    RedisService redisService;

    @PostMapping("/login")
    @ApiOperation(value = "用户登录",tags = "App登录")
    @ApiResponses({
            @ApiResponse(code = 200 ,message = "ok",response = ResponseInfo.class)
    })
    public ResponseInfo login(@RequestBody PadCollectUserRequest sysUser,
                              HttpServletRequest servletRequest){
        return padCollectUserService.login(sysUser,servletRequest);
    }

}
